<div bsModal #actionModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="actionModal" aria-hidden="true"
  [config]="{backdrop: 'static'}">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <form *ngIf="active" #editForm="ngForm" novalidate (ngSubmit)="save()">

        <div class="modal-header">
          <h4 class="modal-title"> 
            <span *ngIf="releaseStockBill.positionId">文件接收</span>
            <span *ngIf="!releaseStockBill.positionId">编辑信息  </span>
          </h4>
          <button type="button" class="close" (click)="close()" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>

        <div class="modal-body" style="padding-top: 0;">
          <div class="into-step techfileBox">
            <p-steps [model]="items" [activeIndex]="activeIndex" styleClass="steps-custom"></p-steps>
          </div>

          <div [hidden]="activeIndex === 1">
            <div class="m-demo" data-code-preview="true" data-code-html="true" data-code-js="false">
              <div class="m-demo__preview text-center">
                <div class="row">
                  <div class="col-md-4">
                    <small class='text-muted'>文件类型</small> 
                    <h6 style='margin-top: 10px;' *ngIf="releaseStockBill.techFileInfoType == 1" > 图纸</h6>
                    <h6 style='margin-top: 10px;' *ngIf="releaseStockBill.techFileInfoType == 2" > 技术通知单 </h6>
                    <h6 style='margin-top: 10px;' *ngIf="releaseStockBill.techFileInfoType == 3" > 偏离单 </h6>
                    <h6 style='margin-top: 10px;' *ngIf="releaseStockBill.techFileInfoType == 4" > 质疑单 </h6>
                    <h6 style='margin-top: 10px;' *ngIf="releaseStockBill.techFileInfoType == 5" > 质量通知单 </h6>
                    <h6 style='margin-top: 10px;' *ngIf="releaseStockBill.techFileInfoType == 6" > 技术条件 </h6>
                    <h6 style='margin-top: 10px;' *ngIf="releaseStockBill.techFileInfoType == 7" > 技术说明书 </h6> 
 
                  </div>
                  <div class="col-md-4">
                    <small class='text-muted'>文件信息名称</small>
                    <h6 style='margin-top: 10px;'>{{releaseStockBill.fileName}}</h6>
                  </div>
                  <div class="col-md-4">
                    <small class='text-muted'>图号</small>
                    <h6 style='margin-top: 10px;'>{{releaseStockBill.drawingCode}}</h6>
                  </div> 
                </div>
              </div>
            </div> 

            <div class="m-demo" data-code-preview="true" data-code-html="true" data-code-js="false">
              <div class="m-demo__preview text-left">
                <label>备注</label> 
                        <textarea class="form-control" style="resize:none;"  type="text" name="remarks" [ngClass]="{'edited': releaseStockBill.remarks}"
                        [(ngModel)]="releaseStockBill.remarks"></textarea>
              </div>
            </div>
          </div>

          <div [hidden]="activeIndex === 0">
            <div class="m-demo" data-code-preview="true" data-code-html="true" data-code-js="false">
              <div class="m-demo__preview text-center">
                <!-- <selectLocation #selectloc [(location)]="releaseStockBill.positionId"></selectLocation> -->
                <div class="row">
                  
                   <div class="col-md-4">
                    <div class="form-group">
                      <select #areaCombobox name="area" class="form-control" [(ngModel)]="areaId" [attr.data-live-search]="true" jq-plugin="selectpicker"
                        (change)="loadShelfs()" title="选择库房"> 
                        <option *ngFor="let area of areas" [value]="area.id">{{area.name}}</option>
                      </select>
                    </div>
                  </div>
                  <div class="col-md-4">
                    <div class="form-group">
                      <select #shelfCombobox name="shelf" class="form-control" [(ngModel)]="shelfId"  [attr.data-live-search]="true"
                      (change)="loadPositions()" title="选择档案柜"> 
                        <option *ngFor="let shelf of shelfs" [value]="shelf.id">{{shelf.name}}</option>
                      </select>
                    </div>
                  </div>
                  <div class="col-md-4">
                    <div class="form-group">
                      <select #positionCombobox name="position" class="form-control" [(ngModel)]="positionId" jq-plugin="selectpicker" [attr.data-live-search]="true"
                      title="选择架位"> 
                        <option *ngFor="let position of positions" [value]="position.id">{{position.name}}</option>
                      </select>
                    </div>
                  </div> 
                </div>
              </div>
            </div>
          </div>

          <div class="row">
            <div class="btn-group btn-group btn-group-justified" style="margin: auto;">
              <button class="btn m-btn--pill m-btn--air btn-warning" [disabled]="activeIndex === 0" (click)="activeIndex = 0">上一步</button>
              <button class="btn m-btn--pill m-btn--air btn-warning" [disabled]="activeIndex === 1" (click)="onNextBtnClick()">下一步</button>
            </div>
          </div>
        </div>

        <div class="modal-footer">
          <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{l("Cancel")}}</button>
          <button *ngIf="!releaseStockBill.positionId"  type="submit" class="btn btn-success" [disabled]="!positionId || !activeIndex" [buttonBusy]="saving" [busyText]="'入库中...'">
            <i class="fa fa-check-circle"></i>
            <span>入库</span>
          </button>
          <button *ngIf="releaseStockBill.positionId" type="button"(click)="update()"  class="btn btn-success" [disabled]="!positionId || !activeIndex" [buttonBusy]="saving" [busyText]="'保存中...'">
            <i class="fa fa-save"></i>
            <span>保存</span>
          </button>
        </div>

      </form>

    </div>
  </div>
</div>
